How to log into the chat room without inputting name and password?


If you have a website and your customers have already logged into your website, they do not want to input name and password again to enter your chat room. Then you need to write a script file that has the ability to get the user name and password and post these information to your chat room automatically.

This is a sample .ASP file (in VBScript):
<%
dim UserName
dim UserPassword
UserName=GetUserName() '<- get the username
UserPassword=GetUserPassword() '<- get the password

function GetUserName()
...
End function

function GetUserPassword()
...
End function
%>
<html>
<head>
<title></title>
<script language="Javascript">
function PostUserName()
{document.form1.submit();}
</script>
</head>
<body onload="PostUserName()">
<form name="form1" method="post" action="http://xxx.xxx.xxx.xxx/chatroom.htm">
<input type="hidden" name="UserName" value="<%=UserName%>">
<input type="hidden" name="Password" value="<%=UserPassword%>">
</form>
</body>
</html>


This page will get the user name and password then post them to the chat room so the user will login without typing anything. But you should write the function "SetUserName()" and "GetUserPassword()" by yourself.

Note:
1) The name of "name field" must be "UserName"
2) The name of "password field" must be "Password"
3) The form must be posted to http://Your IP:chatroom.htm

See Also

Use your own html file for the login page


Copyright © 2003 LionMax Software. All Rights Reserved.